package cn.wolfcode.wolf2w.redis.util;

import cn.wolfcode.wolf2w.util.Consts;
import lombok.Getter;

@Getter
public enum  RedisKeys {
    USER_STRATEGY_THUMBUP("user_strategy_thumbup",-1L),
    USER_STRATEGY_FAVOR("user_strategy_favor",-1L),
    STRATEGY_STATIS_VO("strategy_statis_vo",-1L),
    VERIFY_CODE("verify_code", Consts.VERIFY_CODE_VAI_TIME*60L),
    USER_LOGIN_TOKEN("user_login_token" ,Consts.USER_INFO_TOKEN_VAI_TIME*60L);
    private String prefix ;
    private Long time ;

    private RedisKeys(String prefix,Long time){
            this.prefix=prefix;
            this.time=time;
    }

    public String join(String... values){
        StringBuilder sb = new StringBuilder();
        sb.append(this.prefix);
        for (String value : values) {
            sb.append(":").append(value);
        }
        return sb.toString();
    }
}
